namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0082 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.SysApprovePathSimulate", "ApproverEmployee_PosId", "dbo.hrm_mp_positions");
            DropForeignKey("dbo.SysApprovePathSimulate", "ApproverPosition_PosId", "dbo.hrm_mp_positions");
            DropIndex("dbo.SysApprovePathSimulate", new[] { "ApproverEmployee_PosId" });
            DropIndex("dbo.SysApprovePathSimulate", new[] { "ApproverPosition_PosId" });
            RenameColumn(table: "dbo.SysApprovePathSimulate", name: "ApproverEmployee_PosId", newName: "ApproverEmployee_EmpId");
            AddForeignKey("dbo.SysApprovePathSimulate", "ApproverEmployee_EmpId", "dbo.hrm_ps_employees", "emp_seq");
            CreateIndex("dbo.SysApprovePathSimulate", "ApproverEmployee_EmpId");
            DropColumn("dbo.SysApprovePathSimulate", "ApproverPosId");
            DropColumn("dbo.SysApprovePathSimulate", "ApproverPosition_PosId");
        }
        
        public override void Down()
        {
            AddColumn("dbo.SysApprovePathSimulate", "ApproverPosition_PosId", c => c.Int());
            AddColumn("dbo.SysApprovePathSimulate", "ApproverPosId", c => c.Int());
            DropIndex("dbo.SysApprovePathSimulate", new[] { "ApproverEmployee_EmpId" });
            DropForeignKey("dbo.SysApprovePathSimulate", "ApproverEmployee_EmpId", "dbo.hrm_ps_employees");
            RenameColumn(table: "dbo.SysApprovePathSimulate", name: "ApproverEmployee_EmpId", newName: "ApproverEmployee_PosId");
            CreateIndex("dbo.SysApprovePathSimulate", "ApproverPosition_PosId");
            CreateIndex("dbo.SysApprovePathSimulate", "ApproverEmployee_PosId");
            AddForeignKey("dbo.SysApprovePathSimulate", "ApproverPosition_PosId", "dbo.hrm_mp_positions", "pos_seq");
            AddForeignKey("dbo.SysApprovePathSimulate", "ApproverEmployee_PosId", "dbo.hrm_mp_positions", "pos_seq");
        }
    }
}
